﻿using System;

namespace ElevatorDispatching
{
    /// <summary>
    /// 厅外呼梯信号
    /// </summary>
    public struct CallCageSignal : ICallSignal
    {
        /// <summary>
        /// 呼梯方向
        /// </summary>
        public Direction Direction { get; }

        /// <summary>
        /// 发出呼梯信号的楼层 Id
        /// </summary>
        public int FloorId { get; }

        /// <summary>
        /// 呼梯信号发出的时间点
        /// </summary>
        public DateTimeOffset Time { get; }

        /// <summary>
        /// 构造一个厅外呼梯信号
        /// </summary>
        /// <param name="direction">呼梯方向</param>
        /// <param name="floorId">发出呼梯信号的楼层 Id</param>
        /// <param name="time">呼梯信号发出的时间点，为空时即为系统当前时间。</param>
        public CallCageSignal(Direction direction, int floorId, DateTimeOffset? time = null)
        {
            Direction = direction;
            FloorId = floorId;
            Time = time ?? DateTimeOffset.Now;
        }
    }
}
